<template>
  <div>
    <table>
      <tr v-for="(row, index) in TimeList" :key="index">
        <td v-for="(value, key) in row" :key="key" @click="getValue(index, key)">
          {{ value }}
        </td>
      </tr>
    </table>
    <p>点击的行列值: {{ clickedValue }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      TimeList: [
        { name1: "07:00", name2: "13:00", name3: "19:00", name4: "01:00" },
        { name1: "08:00", name2: "14:00", name3: "20:00", name4: "02:00" },
        { name1: "09:00", name2: "15:00", name3: "21:00", name4: "03:00" },
        { name1: "10:00", name2: "16:00", name3: "22:00", name4: "04:00" },
        { name1: "11:00", name2: "17:00", name3: "23:00", name4: "05:00" },
        { name1: "12:00", name2: "18:00", name3: "00:00", name4: "06:00" }
      ],
      clickedValue: ""
    };
  },
  methods: {
    getValue(rowIndex, columnName) {
      this.clickedValue = this.TimeList[rowIndex][columnName];
    }
  }
};
</script>